﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Silvery
{
    public sealed class GlobaleMethod
    {
        public static void ClearaLayout(Panel layout)
        {
            foreach (var item in layout.Children)
            {
                if (item is Image)
                    (item as Image).Source = null;
                else
                    if (item is Panel)
                        ClearaLayout(item as Panel);
            }
            layout.Children.Clear();
        }
        public static Point ConvertToLogicPosition(Point pos)
        {
            return new Point(pos.X / GlobleConfig.SceneGridSize.Width, pos.Y / GlobleConfig.SceneGridSize.Height);
        }
    }
}
